]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
js: Stop using {v,h}scroll properties
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 15 Nov 2023 13:31:37 +0000 (14:31 +0100)
committerMarge Bot <marge-bot@gnome.org>
Sat, 18 Nov 2023 18:00:43 +0000 (18:00 +0000)
We only use them to access the corresponding adjustments, and
ScrollView now exposes those directly.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3020>

js/gdm/authList.js
js/gdm/loginDialog.js
js/misc/animationUtils.js
js/ui/appDisplay.js
js/ui/components/telepathyClient.js
js/ui/lookingGlass.js
js/ui/search.js
js/ui/switcherPopup.js

index e0351a2715dc2d6440d11c76c23f0c1706d2b572..7f860a7816ab6f12598b2f0f7b6e13327ee330db 100644 (file)
@@ -128,7 +128,7 @@ export const AuthList = GObject.registerClass({
     scrollToItem(item) {
         let box = item.get_allocation_box();
 
-        const {adjustment} = this._scrollView.vscroll;
+        const adjustment = this._scrollView.vadjustment;
 
         let value = (box.y1 + adjustment.step_increment / 2.0) - (adjustment.page_size / 2.0);
         adjustment.ease(value, {
index f3afdbb5e0e71b867322964c401ee4e704419666..8644bf3d59d8ad9492791e60cc0a2fb63b4ad81d 100644 (file)
@@ -224,7 +224,7 @@ const UserList = GObject.registerClass({
     scrollToItem(item) {
         let box = item.get_allocation_box();
 
-        const {adjustment} = this.vscroll;
+        const adjustment = this.vadjustment;
 
         let value = (box.y1 + adjustment.step_increment / 2.0) - (adjustment.page_size / 2.0);
         adjustment.ease(value, {
@@ -236,7 +236,7 @@ const UserList = GObject.registerClass({
     jumpToItem(item) {
         let box = item.get_allocation_box();
 
-        const {adjustment} = this.vscroll;
+        const adjustment = this.vadjustment;
 
         let value = (box.y1 + adjustment.step_increment / 2.0) - (adjustment.page_size / 2.0);
 
index 1562f1018f0c15462ff4cb4962e935f4da017392..a7a0ea8b0b37d7aa788bc3ea930f0591dcc19f12 100644 (file)
@@ -32,7 +32,7 @@ export function adjustAnimationTime(msecs) {
  * @param {Clutter.Actor} actor - the actor
  */
 export function ensureActorVisibleInScrollView(scrollView, actor) {
-    const {adjustment} = scrollView.vscroll;
+    const adjustment = scrollView.vadjustment;
     let [value, lower_, upper, stepIncrement_, pageIncrement_, pageSize] = adjustment.get_values();
 
     let offset = 0;
index 44bcd3dbf193228de815359720f8e3776f5fd216..b03f024ac1f0cdbc32c29456cdf28c6a103ed22c 100644 (file)
@@ -529,8 +529,7 @@ var BaseAppView = GObject.registerClass({
         this._scrollTimeoutId = 0;
         this._scrollView.connect('scroll-event', this._onScroll.bind(this));
 
-        const scroll = this._scrollView.hscroll;
-        this._adjustment = scroll.adjustment;
+        this._adjustment = this._scrollView.hadjustment;
         this._adjustment.connect('notify::value', adj => {
             const value = adj.value / adj.page_size;
             this._pageIndicators.setCurrentPosition(value);
@@ -2375,7 +2374,7 @@ export const FolderIcon = GObject.registerClass({
 
     open() {
         this._ensureFolderDialog();
-        this.view._scrollView.vscroll.adjustment.value = 0;
+        this.view._scrollView.vadjustment.value = 0;
         this._dialog.popup();
     }
 
index 41f1be7043f3daf4b25ac786170701d95b10b95a..4a66d915164f2a21e4f7436cc27a51a51b27afe2 100644 (file)
@@ -890,8 +890,8 @@ class ChatNotificationBanner extends MessageTray.NotificationBanner {
         // Keep track of the bottom position for the current adjustment and
         // force a scroll to the bottom if things change while we were at the
         // bottom
-        this._oldMaxScrollValue = this._scrollArea.vscroll.adjustment.value;
-        this._scrollArea.vscroll.adjustment.connect('changed', adjustment => {
+        this._oldMaxScrollValue = this._scrollArea.vadjustment.value;
+        this._scrollArea.vadjustment.connect('changed', adjustment => {
             if (adjustment.value === this._oldMaxScrollValue)
                 this.scrollTo(St.Side.BOTTOM);
             this._oldMaxScrollValue = Math.max(adjustment.lower, adjustment.upper - adjustment.page_size);
@@ -917,7 +917,7 @@ class ChatNotificationBanner extends MessageTray.NotificationBanner {
     }
 
     scrollTo(side) {
-        let adjustment = this._scrollArea.vscroll.adjustment;
+        let adjustment = this._scrollArea.vadjustment;
         if (side === St.Side.TOP)
             adjustment.value = adjustment.lower;
         else if (side === St.Side.BOTTOM)
index 8da25d6b4c9c9b9dd84d039ceb5683b5a1c19734..aa422473f7d9aea9b93a1929a9e9a6a79a4773d3 100644 (file)
@@ -179,7 +179,7 @@ const Notebook = GObject.registerClass({
         scrollview.hide();
         this.add_child(scrollview);
 
-        let vAdjust = scrollview.vscroll.adjustment;
+        const vAdjust = scrollview.vadjustment;
         vAdjust.connect('changed', () => this._onAdjustScopeChanged(tabData));
         vAdjust.connect('notify::value', () => this._onAdjustValueChanged(tabData));
 
@@ -238,7 +238,7 @@ const Notebook = GObject.registerClass({
     }
 
     _onAdjustValueChanged(tabData) {
-        let vAdjust = tabData.scrollView.vscroll.adjustment;
+        const vAdjust = tabData.scrollView.vadjustment;
         if (vAdjust.value < (vAdjust.upper - vAdjust.lower - 0.5))
             tabData._scrolltoBottom = false;
     }
@@ -246,7 +246,7 @@ const Notebook = GObject.registerClass({
     _onAdjustScopeChanged(tabData) {
         if (!tabData._scrollToBottom)
             return;
-        let vAdjust = tabData.scrollView.vscroll.adjustment;
+        const vAdjust = tabData.scrollView.vadjustment;
         vAdjust.value = vAdjust.upper - vAdjust.page_size;
     }
 
index 2cc35734406cde5097e248c132a60816d5a88660..63b034d3c22b3e8a7cda8d962d7c5edc80a0da6c 100644 (file)
@@ -751,7 +751,7 @@ export const SearchResultsView = GObject.registerClass({
 
     _onPan(action) {
         let [dist_, dx_, dy] = action.get_motion_delta(0);
-        let adjustment = this._scrollView.vscroll.adjustment;
+        let adjustment = this._scrollView.vadjustment;
         adjustment.value -= (dy / this.height) * adjustment.page_size;
         return false;
     }
index 9017d2c9eaf0972edaba91e034bb6d1273487ac5..9b956e8d46d275731acf7e21b24e68fcc4396b75 100644 (file)
@@ -501,7 +501,7 @@ export const SwitcherList = GObject.registerClass({
 
         this._highlighted = index;
 
-        let adjustment = this._scrollView.hscroll.adjustment;
+        const adjustment = this._scrollView.hadjustment;
         let [value] = adjustment.get_values();
         let [absItemX] = this._items[index].get_transformed_position();
         let [result_, posX, posY_] = this.transform_stage_point(absItemX, 0);
@@ -513,7 +513,7 @@ export const SwitcherList = GObject.registerClass({
     }
 
     _scrollToLeft(index) {
-        let adjustment = this._scrollView.hscroll.adjustment;
+        const adjustment = this._scrollView.hadjustment;
         let [value, lower_, upper, stepIncrement_, pageIncrement_, pageSize] = adjustment.get_values();
 
         let item = this._items[index];
@@ -536,7 +536,7 @@ export const SwitcherList = GObject.registerClass({
     }
 
     _scrollToRight(index) {
-        let adjustment = this._scrollView.hscroll.adjustment;
+        const adjustment = this._scrollView.hadjustment;
         let [value, lower_, upper, stepIncrement_, pageIncrement_, pageSize] = adjustment.get_values();
 
         let item = this._items[index];